<div class="clear mainbox-title-container">

	<h1 class="mainbox-title float-left"><?php echo t('Cộng tác viên'); ?></h1>

	<div class="tools-container">
		<span class="action-add">
			<?php echo CHtml::link(t('Add CTV'), array('/user/addCTV')); ?>
		</span>
	</div>
</div>

<div class="mainbox-body">

<?php

$this->widget('ext.EGridView', array
(
	'id' => 'users-list',
	'cssFile' => false,
	'dataProvider' => $dataProvider,
	//'filter' => $users,
	'columns' => array (
		array (
			'header' => t('ID'),
			'headerHtmlOptions' => array('width' => '2%', 'class' => 'center'),
			'name' => 'user_id',
			'htmlOptions' => array(),
		),
		array (
			'header' => t('Username'),
			'name' => 'name',
			'htmlOptions' => array(),
			'type' => 'raw',
			'value' => 'CHtml::link($data->name, array("user/updateCTV", "id" => $data->user_id))',
		),
		array (
			'header' => t('Email'),
			'headerHtmlOptions' => array('width' => '20%'),
			'name' => 'email',
			'type' => 'raw',
			'htmlOptions' => array(),
			'value' => 'CHtml::link($data->email, array("user/updateCTV", "id" => $data->user_id))',
		),
		array (
			'header' => t('Registered Date'),
			'headerHtmlOptions' => array('width' => '15%'),
			'name' => 'email',
			'value' => 'date(app()->params["longDateFormat"], $data->timestamp)',
			'htmlOptions' => array(),
		), 
		array(
			'header' => t('Status'),
			'headerHtmlOptions' => array('width' => '10%'),
			'class' => 'MyStatusColumn',
			"update_controller" => "user",
			"update_action" => "updateStatus",
			"id_field" => 'user_id',
		),
		array(
			'headerHtmlOptions' => array('width' => '5%'),
			'class'=>'CButtonColumn',
			'template'=>'{update}',
			'deleteButtonUrl' => 'Yii::app()->createUrl("/user/delete", array("id" =>  $data->user_id))',
			'updateButtonUrl' => 'Yii::app()->createUrl("/user/updateCTV", array("id" =>  $data->user_id))',
		),
	),
));

?>

</div>